package com.heima.article.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heima.article.dtos.ApArticleConfigDto;
import com.heima.article.mapper.ApArticleMapper;
import com.heima.article.pojos.ApArticleConfig;
import com.heima.article.service.ApArticleConfigService;
import com.heima.article.mapper.ApArticleConfigMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 郭文杰
* @description 针对表【ap_article_config(APP已发布文章配置表)】的数据库操作Service实现
* @createDate 2023-12-02 11:42:51
*/
@Service
public class ApArticleConfigServiceImpl extends ServiceImpl<ApArticleConfigMapper, ApArticleConfig>
    implements ApArticleConfigService{

    @Autowired
    private ApArticleConfigMapper apArticleConfigMapper;

    /**
     * 查询文章配置信息
     * @param apArticleConfigDto 前端dto
     * @return 返回结果
     */
    @Override
    public ApArticleConfig getArticleConfig(ApArticleConfigDto apArticleConfigDto) {
        if (apArticleConfigDto == null) {
            return null;
        }
        ApArticleConfig apArticleConfig = apArticleConfigMapper.selectArticleConfig(apArticleConfigDto);
        return apArticleConfig;
    }

    @Override
    public void updateArticleConfig(ApArticleConfigDto apArticleConfigDto) {
        if (apArticleConfigDto == null) {
            return;
        }
        apArticleConfigMapper.updateArticleConfig(apArticleConfigDto);
    }
}




